<template>
  <div class="app-container">
    <div class="container">
      <div class="main page page-list">
        <div class="head-container">
          <el-card shadow="never">
            <div class="search-bar pd">
              <el-form :inline="true" :model="searchModel" size="mini" class="demo-form-inline">
                <el-form-item label="商户编号">
                  <el-input v-model="searchModel.id" placeholder="商户编号"></el-input>
                </el-form-item>

                <el-form-item label="商户名称">
                  <el-input v-model="searchModel.name" placeholder="商户名称"></el-input>
                </el-form-item>

                <el-form-item label="手机号">
                  <el-input v-model="searchModel.mobile" placeholder="手机号"></el-input>
                </el-form-item>
                <el-form-item label="合伙人编号">
                  <el-input v-model="searchModel.partnerId" placeholder="合伙人编号"></el-input>
                </el-form-item>

                <el-form-item label="多商户管理账号">
                  <el-input v-model="searchModel.operatorUserMobile" placeholder="多商户管理账号"></el-input>
                </el-form-item>

                <el-form-item label="注册时间">
                  <el-date-picker v-model="searchModel.registerTime" type="datetimerange" start-placeholder="开始日期"
                    end-placeholder="结束日期" :default-time="['00:00:00']" value-format="yyyy-MM-dd HH:mm:ss">
                  </el-date-picker>
                </el-form-item>

                <el-form-item>
                  <el-button type="primary" @click="searchPage">查询</el-button>
                  <el-button type="default" @click="reset">重置</el-button>
                </el-form-item>
              </el-form>
            </div>
          </el-card>
        </div>

        <div class="data-list-wrap">
          <el-card shadow="never">
            <el-table size="mini" v-loading="loading" :data="list" style="width: 100%">

              <el-table-column prop="registerTime" label="注册时间" fixed="left">
              </el-table-column>

              <el-table-column label="基本信息" fixed="left" width="180">
                <template slot-scope="scope">
                  <div>
                    商户名称：<span class="text-bold-18">{{
                      scope.row.name ? scope.row.name : "-"
                    }}</span>
                  </div>
                  <div>
                    手机号：<span class="text-bold-18">{{
                      scope.row.mobile
                    }}</span>
                  </div>
                  <div>
                    商户编号：<span class="text-bold-18">{{
                      scope.row.id
                    }}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column label="状态">
                <template slot-scope="scope">
                  <span class="text-success" v-if="scope.row.securityStatus === 0">正常</span>
                  <span class="text-danger" v-if="scope.row.securityStatus === -1">已冻结</span>
                  <div class="text-danger" v-if="scope.row.securityRemark">
                    ({{ scope.row.securityRemark }})
                  </div>
                </template>
              </el-table-column>
              <el-table-column label="业务备注">
                <template slot-scope="scope">
                  {{ scope.row.remark ? scope.row.remark : "-" }}
                </template>
              </el-table-column>

              <el-table-column label="行业分类">
                <template slot-scope="scope">
                  {{ scope.row.industryCategoryName ? scope.row.industryCategoryName : "-" }}
                </template>
              </el-table-column>

              <el-table-column label="体量">
                <template slot-scope="scope">
                  {{ scope.row.volumeDesc ? scope.row.volumeDesc : "-" }}
                </template>
              </el-table-column>

              <el-table-column label="有密签约">
                <template slot-scope="scope">
                  {{ scope.row.payTransSignCount ? scope.row.payTransSignCount : "0" }}
                </template>
              </el-table-column>

              <el-table-column label="安全发签约">
                <template slot-scope="scope">
                  {{ scope.row.safePaySignCount ? scope.row.safePaySignCount : "0" }}
                </template>
              </el-table-column>

              <el-table-column label="批量有密日额度">
                <template slot-scope="scope">
                  <div>{{ scope.row.userProfile.transAmountDayLimit }}</div>
                </template>
              </el-table-column>
              <el-table-column label="安全发日额度">
                <template slot-scope="scope">
                  <div>{{ scope.row.userProfile.safePayTransAmountDayLimit }}</div>
                </template>
              </el-table-column>
              <el-table-column label="到支付宝服务费" width="100">
                <template slot-scope="scope">
                  <div v-if="scope.row.mode === 'fixed_ratio'">
                    <span class="text-bold-18">{{ (scope.row.serviceRatio * 100).toFixed(2) }}%</span>
                  </div>
                  <div v-if="scope.row.mode === 'fixed_amount'">
                    ¥
                    <span class="text-bold-18">{{
                      scope.row.serviceUnitPrice / 100
                    }}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column width="100">
                <template slot-scope="{}" slot="header">
                  <span>到银行卡服务费</span>
                  <el-tooltip class="item" placement="bottom">
                    <div slot="content">
                      <span>0.1%的成本</span>
                    </div>
                    <i class="el-icon-info tip"></i>
                  </el-tooltip>
                </template>
                <template slot-scope="scope">
                  <div v-if="scope.row.mode === 'fixed_ratio'">
                    <span class="text-bold-18">{{ (scope.row.bankServiceRatio * 100).toFixed(2) }}%</span>
                  </div>
                  <div v-if="scope.row.mode === 'fixed_amount'">
                    ¥
                    <span class="text-bold-18">{{
                      scope.row.bankServiceUnitPrice / 100
                    }}</span>
                  </div>
                </template>
              </el-table-column>
              <el-table-column label="合伙人结算分成费率/比例" width="220">
                <template slot-scope="scope">
                  <div v-if="scope.row.partnerId">
                    <div v-if="scope.row.mode === 'fixed_ratio'">
                      <div v-if="scope.row && scope.row.commissionMode === 'cost_mode'">
                        <div>
                          到支付宝:<span class="text-bold-18">{{ (scope.row.partnerServiceRatio * 100).toFixed(2) }}%</span><span class="text-info">(平台收取{{ (scope.row.costServiceRatio * 100).toFixed(2) }}%)</span>
                        </div>
                        <div>
                          到卡:<span class="text-bold-18">{{ (scope.row.partnerBankServiceRatio * 100).toFixed(2)}}%</span><span class="text-info">(平台收取{{ (scope.row.bankCostServiceRatio * 100).toFixed(2) }}%)</span>
                        </div>
                        <!-- <div>
                          到支付宝成本费率：<span class="text-bold-18">{{ (scope.row.costServiceRatio * 100).toFixed(2) }}%</span>
                        </div>
                        <div>
                          到卡成本费率：<span class="text-bold-18">{{ (scope.row.bankCostServiceRatio * 100).toFixed(2)
                          }}%</span>
                        </div> -->
                      </div>
                      <div v-else>
                        <span class="text-bold-18">{{ (scope.row.benefitRatio * 100).toFixed(2) }}%</span>
                      </div>

                    </div>
                    <div v-if="scope.row.mode === 'fixed_amount'">
                      ¥
                      <span class="text-bold-18">{{
                        scope.row.partnerBenefit / 100
                      }}</span>
                    </div>
                  </div>
                  <div v-else>
                    -
                  </div>

                </template>
              </el-table-column>
              <el-table-column label="合伙人编号" width="100">
                <template slot-scope="scope">
                  {{ scope.row.partnerId ? scope.row.partnerId : "-" }}
                  <el-tag v-if="scope.row.partnerId && !scope.row.fatherPartnerId" size="mini" type="success">一级</el-tag>
                  <el-tag v-if="scope.row.partnerId && scope.row.fatherPartnerId" size="mini" type="primary">二级</el-tag>
                </template>
              </el-table-column>

              <el-table-column label="多商户管理账号" width="100">
                <template slot-scope="scope">
                  {{ scope.row.operatorUserAccount ? scope.row.operatorUserAccount : "-" }}
                </template>
              </el-table-column>
              
              <el-table-column label="账户余额" width="100">
                <template slot-scope="scope">
                  ¥
                  <span class="text-bold-18">{{
                    scope.row.moneyLeft / 100
                  }}</span>
                </template>
              </el-table-column>

              <el-table-column label="接口秘钥">
                <template slot-scope="scope">
                  <div v-if="scope.row.hasAppkey">
                    <el-button style="margin-left: 8px" v-permission="['ADMIN', 'user::select-appkey']" size="mini"
                      type="text" plain @click="doSelectAppKey(scope.row.id)">
                      查看秘钥
                    </el-button>
                  </div>
                </template>
              </el-table-column>


              <el-table-column fixed="right" label="操作" width="200">
                <template slot-scope="scope">
                  <div class="operations">
                    <div class="operations-1">

                      <el-button style="margin-left: 8px" v-permission="['ADMIN']" size="mini" type="text" plain
                        @click="doLogin(scope.row)">
                        登录
                      </el-button>

                      <div class="line">|</div>

                      <el-button style="margin-left: 8px" v-permission="[
                        'ADMIN',
                        'user::update-service-unit-price',
                      ]" size="mini" type="text" plain @click="openUpdateServiceUnitPriceDialog(scope.row)">
                        设置服务费
                      </el-button>
                    </div>
                    <div class="operations-1">
                      <el-button v-permission="['ADMIN', 'user::update-user-info']" size="mini" type="text" plain
                        style="margin-left: 8px" @click="openUpdateUserInfoDialog(scope.row)">
                        修改信息
                      </el-button>

                      <div class="line">|</div>

                      <el-button v-permission="['ADMIN', 'user::update-mobile']" size="mini" type="text" plain
                        style="margin-left: 8px" @click="openUpdatePhone(scope.row)">
                        修改手机号
                      </el-button>
                    </div>
                    <div class="operations-1">
                      <el-button v-permission="['ADMIN', 'user::update-user-security-status']" size="mini" type="text" plain
                        style="margin-left: 8px" @click="openUpdateUserSecurityStatusDialog(scope.row)">
                        修改用户状态
                      </el-button>

                      <div class="line">|</div>

                      <el-button v-permission="['ADMIN', 'user::create-appkey']" size="mini" type="text" plain
                        style="margin-left: 8px" @click="createAppkey(scope.row)">
                        生成接口秘钥
                      </el-button>

                    </div>

                    <!-- <div class="operations-1">
                    <el-button v-permission="['ADMIN', 'charge-record::charge-by-admin']" size="mini" type="text" plain style="margin-left: 8px"
                      @click="charge(scope.row)">
                      手工充值
                    </el-button>

                    <div class="line">|</div>

                    <el-button style="margin-left: 8px" v-permission="[
                      'ADMIN',
                      'charge-record::charge-trans-batch-by-admin',
                    ]" size="mini" type="text" plain @click="chargeTb(scope.row)">
                      充值体验次数
                    </el-button>
                    </div> -->

                    <div class="operations-1">
                      <el-button v-permission="[
                        'ADMIN',
                        'user::update-user-charge-notify-url',
                      ]" size="mini" type="text" plain style="margin-left: 8px" @click="chargeNotifyUrl(scope.row)">
                        设置推送地址
                      </el-button>

                      <div class="line">|</div>

                      <el-button v-permission="[
                        'ADMIN',
                        'user-registration::submit',
                      ]" size="mini" type="text" plain style="margin-left: 8px"
                        @click="userRegistration(scope.row.id)">
                        注册报备
                      </el-button>
                    </div>

                    <div class="operations-1">

                      <el-button v-permission="[
                        'ADMIN',
                        'user::update-partner',
                      ]" size="mini" type="text" plain style="margin-left: 8px" @click="updatePartner(scope.row)">
                        合伙人换绑
                      </el-button>

                    </div>


                    <!-- <el-button
                      v-permission="[
                        'ADMIN',
                        'safe-pay-book-account::update',
                      ]"
                      size="mini"
                      type="text"
                      plain
                      @click="whiteSafePayAccount(scope.row)"
                    >
                      安全发支付宝加白
                    </el-button> -->



                    <!-- <div v-permission="['ADMIN', 'user::update-open-charge']" style="margin-left: 10px">
                      <span>开放充值页面</span>
                      <el-popover :ref="'openCharge' + scope.row.id" placement="top" width="200" trigger="click">
                        <p v-if="!scope.row.userProfile.openCharge">
                          确定开放充值页面？
                        </p>
                        <p v-if="scope.row.userProfile.openCharge">
                          确定关闭充值页面？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openCharge' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenCharge(
                              !scope.row.userProfile.openCharge,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openCharge" active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div> -->

                    <div v-permission="['ADMIN', 'user::update-open-safe-pay']" style="margin-left: 10px">
                      <span>开放安全发接口</span>
                      <el-popover :ref="'openSafePay' + scope.row.id" placement="top" width="200" trigger="click">
                        <p v-if="!scope.row.userProfile.openSafePay">
                          确定开放安全发接口？
                        </p>
                        <p v-if="scope.row.userProfile.openSafePay">
                          确定关闭开放安全发接口？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openSafePay' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenSafePay(
                              !scope.row.userProfile.openSafePay,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openSafePay" active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div>
                    <!-- <div v-permission="['ADMIN', 'user::update-open-auto-pay']" style="margin-left: 10px">
                      <span>开放鱼塘付接口</span>
                      <el-popover :ref="'openAutoPay' + scope.row.id" placement="top" width="200" trigger="click">
                        <p v-if="!scope.row.userProfile.openAutoPay">
                          确定开放鱼塘付接口？
                        </p>
                        <p v-if="scope.row.userProfile.openAutoPay">
                          确定关闭开放鱼塘付接口？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openAutoPay' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenAutoPay(
                              !scope.row.userProfile.openAutoPay,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openAutoPay" active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div> -->

                    <div v-permission="['ADMIN']" style="margin-left: 10px">
                      <span>开启安全发汇款充值</span>
                      <el-popover :ref="'openSafePayOfflineCharge' + scope.row.id" placement="top" width="200"
                        trigger="click">
                        <p v-if="!scope.row.userProfile.openSafePayOfflineCharge">
                          确定开放安全发汇款充值？
                        </p>
                        <p v-if="scope.row.userProfile.openSafePayOfflineCharge">
                          确定关闭安全发汇款充值？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openSafePayOfflineCharge' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenSafePayOfflineCharge(
                              !scope.row.userProfile.openSafePayOfflineCharge,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openSafePayOfflineCharge"
                          active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div>
                    <!-- <div v-permission="['ADMIN', 'user::update-open-collection-safe-pay']" style="margin-left: 10px">
                      <span>开放收集到卡功能</span>
                      <el-popover :ref="'openCollectionSafePay' + scope.row.id" placement="top" width="200"
                        trigger="click">
                        <p v-if="!scope.row.userProfile.openCollectionSafePay">
                          确定开放鱼塘付接口？
                        </p>
                        <p v-if="scope.row.userProfile.openCollectionSafePay">
                          确定关闭开放鱼塘付接口？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openCollectionSafePay' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenCollectionSafePay(
                              !scope.row.userProfile.openCollectionSafePay,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openCollectionSafePay"
                          active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div> -->

                    <!-- 开放安全发到卡接口 -->
                    <div v-permission="['ADMIN', 'user::update-open-safe-pay-bank']" style="margin-left: 10px">
                      <span>开放安全发到卡接口</span>
                      <el-popover :ref="'openSafePayBank' + scope.row.id" placement="top" width="200" trigger="click">
                        <p v-if="!scope.row.userProfile.openSafePayBank">
                          确定开放安全发到卡接口？
                        </p>
                        <p v-if="scope.row.userProfile.openSafePayBank">
                          确定关闭开放安全发到卡接口？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openSafePayBank' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenSafePayBank(
                              !scope.row.userProfile.openSafePayBank,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openSafePayBank" active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div>

                    <!-- 开启安全发签约授权新方式 -->
                    <div v-permission="['ADMIN', 'user::update-open-safe-pay-new-sign-method']" style="margin-left: 10px">
                      <span>开放安全发签约新方式</span>
                      <el-popover :ref="'openSafePayNewSignMethod' + scope.row.id" placement="top" width="200"
                        trigger="click">
                        <p v-if="!scope.row.userProfile.openSafePayNewSignMethod">
                          确定开放安全发签约新方式？
                        </p>
                        <p v-if="scope.row.userProfile.openSafePayNewSignMethod">
                          确定关闭开放安全发签约新方式？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openSafePayNewSignMethod' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenSafePayNewSignMethod(
                              !scope.row.userProfile.openSafePayNewSignMethod,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openSafePayNewSignMethod"
                          active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div>

                    <!-- 开放开具发票接口 -->
                    <div v-permission="['ADMIN', 'user::update-open-invoice']" style="margin-left: 10px">
                      <span>开放开具发票接口</span>
                      <el-popover :ref="'openInvoice' + scope.row.id" placement="top" width="200" trigger="click">
                        <p v-if="!scope.row.userProfile.openInvoice">
                          确定开放开具发票接口？
                        </p>
                        <p v-if="scope.row.userProfile.openInvoice">
                          确定关闭开放开具发票接口？
                        </p>
                        <div style="text-align: right; margin: 0">
                          <el-button size="mini" type="text" @click="
                            $refs['openInvoice' + scope.row.id].doClose()
                            ">取消
                          </el-button>
                          <el-button :loading="opLoading" type="primary" size="mini" @click="
                            handleOpenInvoice(
                              !scope.row.userProfile.openInvoice,
                              scope.row.id
                            )
                            ">确定
                          </el-button>
                        </div>
                        <el-switch slot="reference" :value="scope.row.userProfile.openInvoice" active-color="#13ce66">
                        </el-switch>
                      </el-popover>
                    </div>


                  </div>
                </template>
              </el-table-column>
            </el-table>
            <div class="paging-wrap">
              <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
                :current-page="searchModel.pageNo" :page-sizes="[10, 20, 50, 100]" :page-size="searchModel.pagesize"
                layout="total, sizes, prev, pager, next, jumper" :total="searchModel.count">
              </el-pagination>
            </div>

          </el-card>

        </div>

     
        <!-- 注册商户后续信息 -->
        <el-dialog title="商户信息" :close-on-click-modal="false" :modal-append-to-body="false" class="dialog-action"
          width="50%" :visible.sync="dialogRegisterInfo">
          <el-form :model="registerForm" label-width="100px" ref="successRegisterForm">
            <el-form-item label-width="28px">
              <el-button :loading="opLoading" type="primary" @click="doCopy($event)">复制</el-button>
            </el-form-item>
            <el-form-item label="商户名称:">
              <span>{{ successRegisterForm.name }}</span>
            </el-form-item>

            <el-form-item label="商户平台:">
              <span>{{ successRegisterForm.website }}</span>
            </el-form-item>

            <el-form-item label="接口网关:">
              <span>{{ successRegisterForm.gateway }}</span>
            </el-form-item>

            <el-form-item label="后台账号:">
              <span>{{ successRegisterForm.mobile }}</span>
            </el-form-item>

            <el-form-item label="初始密码:">
              <span class="text-danger">{{ successRegisterForm.password }}</span>
            </el-form-item>
            <el-form-item label="温馨提示:">
              <span class="text-info">商户平台账号已经开通，请前往商户平台签约支付宝账号（批量有密/安全发）
                通过接口对接的商户，也需要先完成支付宝账号签约，再进行接口对接使用。</span>
            </el-form-item>
            <el-form-item label="签约文档:">
              <span class="text-info">https://www.yuque.com/alipaybhd8fvdaz5/lbezo6/ve7wbqig0mmhradp?singleDoc#
                《企业支付宝签约安全发流程》 密码：tye6。</span>
            </el-form-item>
            <el-form-item label="接口文档:">
              <span class="text-info">https://www.yuque.com/alipaybhd8fvdaz5/vkeaph# 《安全发接口文档》 密码：yf96</span>
            </el-form-item>


          </el-form>
          <!-- <div slot="footer" class="dialog-footer">
            <el-button :loading="opLoading" type="primary" @click="doCopy($event)">复制</el-button>
          </div> -->
        </el-dialog>
        <!-- 设置服务费 -->
        <el-dialog :title="'设置服务费 ' + servicePriceForm.id" :close-on-click-modal="false" :modal-append-to-body="false"
          class="dialog-action" width="50%" :visible.sync="updateServiceUnitPriceDialog">
          <el-form :model="servicePriceForm" label-width="240px" :rules="servicePriceRules" ref="servicePriceForm">
            <el-form-item label="合伙人编号" v-if="servicePriceForm.partnerId">
              {{ servicePriceForm.partnerId }}
            </el-form-item>
            <el-form-item label="收费模式">
              <el-radio-group v-model="servicePriceForm.mode">
                <el-radio-button label="fixed_ratio">按照转账金额 * 费率收费</el-radio-button>
                <el-radio-button disabled label="fixed_amount">按笔数收费</el-radio-button>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="分佣方式"
              v-if="servicePriceForm.partnerId && servicePriceForm.commissionMode != 'stat_mode'">
              <el-radio-group v-model="servicePriceForm.commissionMode">
                <el-radio-button label="fixed_mode">固定百分比模式</el-radio-button>
                <el-radio-button label="cost_mode">成本模式</el-radio-button>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="分佣方式"
              v-if="servicePriceForm.partnerId && servicePriceForm.commissionMode === 'stat_mode'">
              <el-radio-group v-model="servicePriceForm.commissionMode">
                <el-radio-button label="stat_mode">内部结算模式</el-radio-button>
              </el-radio-group>
            </el-form-item>
            <div v-if="servicePriceForm.mode === 'fixed_ratio'">
              <el-form-item label="到户费率" prop="serviceRatio">
                <el-input type="number" v-model="servicePriceForm.serviceRatio" placeholder="请输入到户费率 0.001表示0.1% 即千1"></el-input>
              </el-form-item>
              <el-form-item label="到卡费率" prop="bankServiceRatio">
                <el-input type="number" v-model="servicePriceForm.bankServiceRatio" placeholder="请输入到卡费率 0.001表示0.1% 即千1"></el-input>
              </el-form-item>
              <!-- 成本模式 -->
              <el-form-item v-if="servicePriceForm.pma && servicePriceForm.commissionMode === 'cost_mode'"
                label="到户成本" prop="costServiceRatio">
                <el-input type="number" v-model="servicePriceForm.costServiceRatio"
                  placeholder="请输入到户成本，例如0.001表示0.1% 即千1"></el-input>
              </el-form-item>
              <el-form-item v-if="servicePriceForm.pma && servicePriceForm.commissionMode === 'cost_mode'"
                label="到卡成本" prop="bankCostServiceRatio">
                <el-input type="number" v-model="servicePriceForm.bankCostServiceRatio"
                  placeholder="请输入到卡成本，例如0.001表示0.1% 即千1"></el-input>
              </el-form-item>

              <el-form-item v-if="servicePriceForm.fatherPartnerId && servicePriceForm.commissionMode === 'cost_mode'"
                label="上级模式" prop="bankCostServiceRatio">
                <el-radio-group v-model="servicePriceForm.fatherCommissionMode">
                <el-radio-button label="fixed_mode">上级比例</el-radio-button>
                <el-radio-button label="cost_mode">指定上级费率</el-radio-button>
              </el-radio-group>
              </el-form-item>
            
               <!--  成本模式 / 指定上级费率-->
               <el-form-item v-if="servicePriceForm.fatherPartnerId && servicePriceForm.commissionMode === 'cost_mode' && servicePriceForm.fatherCommissionMode === 'cost_mode'"
                label="到户上级合伙人分佣费率" prop="fatherServiceRatio">
                <el-input type="number" v-model="servicePriceForm.fatherServiceRatio"
                  placeholder="请输入到户上级合伙人分佣费率 0.001表示0.1% 即千1"></el-input>
              </el-form-item>
              <el-form-item v-if="servicePriceForm.fatherPartnerId && servicePriceForm.commissionMode === 'cost_mode' && servicePriceForm.fatherCommissionMode === 'cost_mode'"
                label="到卡上级合伙人分佣费率" prop="fatherBankServiceRatio">
                <el-input type="number" v-model="servicePriceForm.fatherBankServiceRatio"
                  placeholder="请输入到卡上级合伙人分佣费率 0.001表示0.1% 即千1"></el-input>
                  <div>
                    <span style="font-size: 12px">上级合伙人分佣 = 商户服务费支出 * 合伙人分佣费率</span>
                  </div>
              </el-form-item>
                

                <!--  成本模式 / 上级比例-->
                <el-form-item v-if="servicePriceForm.fatherPartnerId && servicePriceForm.commissionMode === 'cost_mode' && servicePriceForm.fatherCommissionMode === 'fixed_mode'"
                label="上级合伙人分佣比例" prop="fatherBenefitRatio">
                <el-input type="number" v-model="servicePriceForm.fatherBenefitRatio"
                  placeholder="请输入上级合伙人分佣比例，例如0.1表示10%"></el-input>
              </el-form-item>
            
              <!-- 固定百分比 -->
              <el-form-item v-if="servicePriceForm.pma && servicePriceForm.commissionMode === 'fixed_mode'"
                label="合伙人分佣比例" prop="benefitRatio">
                <el-input type="number" v-model="servicePriceForm.benefitRatio"
                  placeholder="请输入合伙人分佣比例，例如0.1表示10%"></el-input>
              </el-form-item>

              <el-form-item v-if="servicePriceForm.fatherPartnerId && servicePriceForm.commissionMode === 'fixed_mode'"
                label="上级合伙人分佣比例" prop="fatherBenefitRatio">
                <el-input type="number" v-model="servicePriceForm.fatherBenefitRatio"
                  placeholder="请输入上级合伙人分佣比例，例如0.1表示10%"></el-input>

                  <div>
                    <span style="font-size: 12px">上级合伙人分佣 = （商户服务费支出 - （商户服务费支出 * 合伙人分佣比例））* 上级合伙人分佣比例</span>
                  </div>
              </el-form-item>

            </div>
            <div v-if="servicePriceForm.mode === 'fixed_amount'">
              <el-form-item label="到户单笔服务费（元）" prop="serviceUnitPrice">
                <el-input type="number" v-model="servicePriceForm.serviceUnitPrice" placeholder="请输入到户单笔服务费"></el-input>
              </el-form-item>
              <el-form-item label="到户单笔服务费（元）" prop="bankServiceUnitPrice">
                <el-input type="number" v-model="servicePriceForm.bankServiceUnitPrice"
                  placeholder="请输入到卡单笔服务费"></el-input>
              </el-form-item>
            </div>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="updateServiceUnitPriceDialog = false">取 消</el-button>
            <el-button :loading="opLoading" type="primary" @click="doUpdateServiceUnitPrice">确 定</el-button>
          </div>
        </el-dialog>
        <!-- 修改信息 -->
        <el-dialog :title="'修改信息 ' + updateUserInfoForm.id" :close-on-click-modal="false" :modal-append-to-body="false"
          class="dialog-action" width="50%" :visible.sync="updateUserInfoDialog">
          <el-form :model="updateUserInfoForm" label-width="160px" ref="updateUserInfoForm">
            <el-form-item label="商户名称" prop="name">
              <el-input v-model="updateUserInfoForm.name" placeholder="商户名称"></el-input>
            </el-form-item>
            <el-form-item label="业务备注" prop="remark">
              <el-input type="textarea" v-model="updateUserInfoForm.remark" placeholder="业务备注"></el-input>
            </el-form-item>

            <el-form-item label="行业分类" prop="industryCategory">
              <el-select v-model="updateUserInfoForm.industryCategory" placeholder="请选择">
                <el-option v-for="item in industryCategorys" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="批量有密日额度" prop="remark">
              <el-input type="number" v-model="updateUserInfoForm.userProfile.transAmountDayLimit"
                placeholder="批量有密日额度（单个支付宝）"></el-input>
            </el-form-item>
            <el-form-item label="安全发日额度" prop="remark">
              <el-input type="number" v-model="updateUserInfoForm.userProfile.safePayTransAmountDayLimit"
                placeholder="安全发日额度（单个企业支付宝）"></el-input>
            </el-form-item>
            <el-form-item label="安全发验证手机号" prop="receiveMobile">
              <el-input v-model="updateUserInfoForm.userProfile.receiveMobile" placeholder="安全发验证手机号"></el-input>
            </el-form-item>
            <el-form-item label="安全发备用验证手机号" prop="spareReceiveMobile">
              <el-input v-model="updateUserInfoForm.userProfile.spareReceiveMobile" placeholder="安全发备用验证手机号"></el-input>
            </el-form-item>
            <el-form-item label="安全发验证最小金额" prop="ensureBatchAmount">
              <el-input v-model="updateUserInfoForm.userProfile.ensureBatchAmount"
                placeholder="安全发验证最小金额，超过该金额需要验证手机号"></el-input>
            </el-form-item>

            <el-form-item label="开启安全发手机号验证" prop="batchEnsure">
              <el-switch v-model="updateUserInfoForm.userProfile.batchEnsure" active-color="#13ce66">
              </el-switch>
            </el-form-item>

            <el-form-item label="开启安全发实名验证" prop="needSafePayAuth">
              <el-switch v-model="updateUserInfoForm.userProfile.needSafePayAuth" active-color="#13ce66">
              </el-switch>
            </el-form-item>

            <el-form-item label="关闭安全发网页转账" prop="needSafePayAuth">
              <el-switch v-model="updateUserInfoForm.userProfile.limitSafePayWebPageTrans" active-color="#13ce66">
              </el-switch>
            </el-form-item>

            <el-form-item label="开启密码加验证码登录" prop="batchEnsure">
              <el-switch v-model="updateUserInfoForm.userProfile.strictLogin" active-color="#13ce66">
              </el-switch>
            </el-form-item>

            <el-form-item label="开启安全发谷歌验证器" prop="batchEnsure">
              <el-switch v-model="updateUserInfoForm.userProfile.useGoogleAuth" active-color="#13ce66">
              </el-switch>
            </el-form-item>

            <el-form-item label="不显示网站客服微信" prop="batchEnsure">
              <el-switch v-model="updateUserInfoForm.userProfile.noWechatQrCode" active-color="#13ce66">
              </el-switch>
            </el-form-item>


          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="updateUserInfoDialog = false">取 消</el-button>
            <el-button :loading="opLoading" type="primary" @click="doUpdateUserInfo">确 定</el-button>
          </div>
        </el-dialog>

        <el-dialog :title="'修改用户状态 ' + updateUserSecurityStatusForm.id" :close-on-click-modal="false"
          :modal-append-to-body="false" class="dialog-action" width="50%" :visible.sync="updateUserSecurityStatusDialog">
          <el-form :model="updateUserSecurityStatusForm" label-width="100px" ref="updateUserSecurityStatusForm">
            <el-form-item label="用户状态" prop="name">
              <el-radio-group v-model="updateUserSecurityStatusForm.securityStatus">
                <el-radio :label="0">正常</el-radio>
                <el-radio :label="-1">冻结</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="备注" prop="remark">
              <el-input type="textarea" v-model="updateUserSecurityStatusForm.securityRemark" placeholder="备注"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="updateUserSecurityStatusDialog = false">取 消</el-button>
            <el-button :loading="opLoading" type="primary" @click="doUpdateUserSecurityStatus">确 定</el-button>
          </div>
        </el-dialog>

        <el-dialog :title="'安全发支付宝加白'" :close-on-click-modal="false" :modal-append-to-body="false" class="dialog-action"
          width="30%" :visible.sync="updateSafePayAccountDialog">
          <el-form :model="updateSafePayAccountForm" label-width="100px" ref="updateSafePayAccountForm">
            <el-form-item label="企业支付宝" prop="remark">
              <el-input v-model="updateSafePayAccountForm.alipayNickName" placeholder="请输入需要加白的企业支付宝"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="updateSafePayAccountDialog = false">取 消</el-button>
            <el-button :loading="opLoading" type="primary" @click="doWhiteSafePayAccount">确 定</el-button>
          </div>
        </el-dialog>

        <!-- 充值 -->
        <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :title="'手工充值 ' + curData.id"
          class="dialog-action" width="50%" :visible.sync="dialogCharge">
          <el-form label-width="100px" :model="form" size="mini" :rules="rules2" ref="form">
            <el-form-item label="充值金额" prop="amount">
              <el-input type="number" v-model="form.amount" @mousewheel.native.prevent placeholder="充值金额"></el-input>
            </el-form-item>
            <el-form-item label="充值备注" prop="memo">
              <el-input type="textarea" v-model="form.memo" placeholder="充值备注"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogCharge = false">取 消</el-button>
            <el-button type="primary" @click="doCharge" :loading="opLoading">确 定</el-button>
          </div>
        </el-dialog>
        <!-- 充值体验次数 -->
        <el-dialog title="充值体验次数" :visible.sync="transBatchgVisible" :close-on-click-modal="false"
          :modal-append-to-body="false">
          <el-form :model="tbForm" ref="tbForm" label-width="150px" :rules="rules3">
            <el-form-item prop="name" label="免费批次数">
              <el-input v-model="tbForm.amount" type="number" placeholder="免费批次数(数字)"></el-input>
            </el-form-item>
          </el-form>

          <span slot="footer" class="dialog-footer">
            <el-button @click="transBatchgVisible = false">取 消</el-button>
            <el-button type="primary" @click="chargeTransBatch" :loading="opLoading">确定</el-button>
          </span>
        </el-dialog>
        <!-- 设置推送地址 -->
        <el-dialog title="设置推送地址" :visible.sync="chargeNotifyUrlVisible" :close-on-click-modal="false"
          :modal-append-to-body="false">
          <el-form :model="cnfForm" ref="cnfForm" label-width="200px">
            <el-form-item prop="chargeNotifyUrl" label="批量转账有密结果推送地址">
              <el-input v-model="cnfForm.chargeNotifyUrl" type="text" placeholder="填写批量转账有密结果推送地址"></el-input>
            </el-form-item>
            <el-form-item prop="openChargeNotify" label="开启批量转账有密推送">
              <el-switch v-model="cnfForm.openChargeNotify" active-color="#13ce66">
              </el-switch>
            </el-form-item>

            <el-form-item prop="name" label="安全发转账结果推送地址">
              <el-input v-model="cnfForm.safePayNotifyUrl" type="text" placeholder="填写安全发转账结果推送地址"></el-input>
            </el-form-item>
            <el-form-item prop="name" label="开启安全发推送">
              <el-switch v-model="cnfForm.openSafePayNotify" active-color="#13ce66">
              </el-switch>
            </el-form-item>
          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="chargeNotifyUrlVisible = false">取 消</el-button>
            <el-button type="primary" @click="setUpchargeNotifyUrl" :loading="opLoading">确定</el-button>
          </span>
        </el-dialog>
        <el-dialog title="记账本查询" :visible.sync="querySafePayBookVisible" width="550px" :close-on-click-modal="false"
          :modal-append-to-body="false">

          <el-form :inline="true" :model="querySafePayBookForm" size="mini">
            <el-form-item prop="bookId" label="记账本ID">
              <el-input v-model="querySafePayBookForm.bookId" placeholder="记账本ID"></el-input>
            </el-form-item>
            <el-form-item prop="bookId" label="记账本ID">
              <el-button type="primary" @click="doQuerySafePayBook">查询</el-button>
            </el-form-item>

          </el-form>
          <div v-loading="querySafePayBookLoading" class="m-t-16" style="background:#f1f1f1;padding:16px;">
            <el-form label-width="130px" v-if="safePayBookAccount">
              <el-form-item label="记账本ID">
                {{ safePayBookAccount.bookId }}
              </el-form-item>
              <el-form-item label="记账本支付宝账号">
                {{ safePayBookAccount.alipayNickName }}
              </el-form-item>
              <el-form-item label="记账本公司名称">
                {{ safePayBookAccount.businessName }}
              </el-form-item>
              <el-form-item label="用户编号">
                {{ safePayBookAccount.userId }}
              </el-form-item>

            </el-form>

            <span v-if="!safePayBookAccount" class="text-info">
              没有查询到该记账本~
            </span>

          </div>
        </el-dialog>
        <!-- 查询安全发总余额 -->
        <el-dialog title="查询安全发总余额" :visible.sync="safePayTotalBalanceSearchDialog" width="35%"
          :close-on-click-modal="false" :modal-append-to-body="false">
          <div v-loading="safePayTotalBalanceSearchLoading">
            <div v-if="!safePayTotalBalanceSearchLoading">
              已签约安全发总余额： <span class="text-primary text-bold font-22">{{ allBookBalance }}</span><span
                class="text-info">元</span>
            </div>
            <div v-else>
              努力查询中...
            </div>
          </div>
        </el-dialog>
        <!-- 注册报备 -->
        <el-dialog title="注册报备" :visible.sync="userRegistrationVisible" :close-on-click-modal="false"
          :modal-append-to-body="false">
          <el-form :model="uRForm" ref="uRForm" :rules="uRFormRef" label-width="200px">
            <el-form-item label="营业执照" prop="businessLicense">
              <div style="display: flex;">
                <el-upload class="avatar-uploader" action="/api/admin/image" :show-file-list="false"
                  accept="image/jpeg,image/png" :on-success="handleAvatarSuccess1" :before-upload="beforeAvatarUpload">
                  <img v-if="uRForm.businessLicense" :src="uRForm.businessLicense" class="avatar" />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>

                <el-button type="text" @click="handlePictureCardPreview(uRForm.businessLicense)"
                  style="margin-left:8px">预览大图</el-button>
              </div>
            </el-form-item>

            <!-- <el-form-item label="法人身份证正面" prop="idCardFront">
              <div style="display: flex;">
                <el-upload class="avatar-uploader" action="/api/admin/image" :show-file-list="false"
                  accept="image/jpeg,image/png" :on-success="handleAvatarSuccess2" :before-upload="beforeAvatarUpload">
                  <img v-if="uRForm.idCardFront" :src="uRForm.idCardFront" class="avatar" />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>

                <el-button type="text" @click="handlePictureCardPreview(uRForm.idCardFront)"
                  style="margin-left:8px">预览大图</el-button>
              </div>

            </el-form-item>

            <el-form-item label="法人身份证反面" prop="idCardBack">
              <div style="display: flex;">
                <el-upload class="avatar-uploader" action="/api/admin/image" :show-file-list="false"
                  accept="image/jpeg,image/png" :on-success="handleAvatarSuccess3" :before-upload="beforeAvatarUpload">
                  <img v-if="uRForm.idCardBack" :src="uRForm.idCardBack" class="avatar" />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>

                <el-button type="text" @click="handlePictureCardPreview(uRForm.idCardBack)"
                  style="margin-left:8px">预览大图</el-button>
              </div>
            </el-form-item> -->

            <el-form-item label="业务场景说明书加公章" prop="bizSceneDesc">
              <div style="display: flex;">
                <el-upload class="avatar-uploader" action="/api/admin/image" :show-file-list="false"
                  accept="image/jpeg,image/png" :on-success="handleAvatarSuccess4" :before-upload="beforeAvatarUpload">
                  <img v-if="uRForm.bizSceneDesc" :src="uRForm.bizSceneDesc" class="avatar" />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>

                <el-button type="text" @click="handlePictureCardPreview(uRForm.bizSceneDesc)"
                  style="margin-left:8px">预览大图</el-button>
              </div>
            </el-form-item>

            <el-form-item label="商户承诺书" prop="merchantCommitment">
              <div style="display: flex;">
                <el-upload class="avatar-uploader" action="/api/admin/image" :show-file-list="false"
                  accept="image/jpeg,image/png" :on-success="handleAvatarSuccess5" :before-upload="beforeAvatarUpload">
                  <img v-if="uRForm.merchantCommitment" :src="uRForm.merchantCommitment" class="avatar" />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>

                <el-button type="text" @click="handlePictureCardPreview(uRForm.merchantCommitment)"
                  style="margin-left:8px">预览大图</el-button>
              </div>
            </el-form-item>

          </el-form>
          <span slot="footer" class="dialog-footer">
            <el-button @click="userRegistrationVisible = false">取 消</el-button>
            <el-button type="primary" @click="submitUserRegistration" :loading="opLoading">提交</el-button>
          </span>
        </el-dialog>
        <!-- 修改手机号 -->
        <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :title="'修改手机号 ' + updatePhoneForm.id"
          class="dialog-action" width="50%" :visible.sync="updatePhoneDialog">
          <el-form label-width="100px" :model="form" size="mini" :rules="rules4" ref="form">
            <el-form-item label="手机号" prop="phone">
              <div>
                <span>{{ updatePhoneForm.mobile }}</span>
              </div>
            </el-form-item>

            <el-form-item label="验证码" prop="checkCode">
              <el-input style="width: 230px; margin-right: 16px" v-model="updatePhoneForm.checkCode" placeholder="请输入验证码"
                class="input-short" size="medium"></el-input>

              <verifyCode @send="sendCheckCode"></verifyCode>
            </el-form-item>

            <el-form-item label="新手机号" prop="newMobile">
              <el-input size="medium" type="number" v-model="updatePhoneForm.newMobile" placeholder="请输入新手机号"></el-input>
            </el-form-item>

          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="updatePhoneDialog = false">取 消</el-button>
            <el-button type="primary" @click="doUpdatePhone" :loading="opLoading">确 定</el-button>
          </div>
        </el-dialog>

        <!-- 合伙人换绑 -->
        <el-dialog title="合伙人换绑" :close-on-click-modal="false" :modal-append-to-body="false" class="dialog-action"
          width="50%" :visible.sync="dialogUpdatePartner">
          <el-form :model="updatePartnerForm" label-width="100px" :rules="rules" ref="updatePartnerForm">

            <el-form-item label="合伙人手机号">
              <el-select v-model="updatePartnerForm.partnerId" placeholder="请选择" clearable filterable>
                <el-option v-for="item in partnerInfoList" :key="item.id" :label="item.showContent" :value="item.id">
                </el-option>
              </el-select>
            </el-form-item>

          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogUpdatePartner = false">取 消</el-button>
            <el-button :loading="opLoading" type="primary" @click="doUpatePartner">确 定</el-button>
          </div>
        </el-dialog>
        <!-- 查看接口秘钥 -->
        <el-dialog title="查看接口秘钥" :close-on-click-modal="false" :modal-append-to-body="false" class="dialog-action"
          width="50%" :visible.sync="selectAppkeyDialog">
          <el-form :model="selectAppkeyForm" label-width="100px">

            <el-form-item label="appkey:">
              <span>{{ selectAppkeyForm.appkey }}</span>
            </el-form-item>

            <el-form-item label="secret:">
              <span>{{ selectAppkeyForm.secret }}</span>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button :loading="opLoading" type="primary" @click="doCopy1($event)">复制</el-button>
          </div>
        </el-dialog>
        <!-- y预览 -->
        <el-dialog class="my-dialog" :visible.sync="previewDialogVisible" :close-on-click-modal="false"
          :modal-append-to-body="false" width="80%">
          <img width="100%" :src="previewImageUrl" />
        </el-dialog>

      </div>
    </div>
  </div>
</template>


<script>
import verifyCode from '../components/verifyCode.vue'
import clipboard from "../../utils/clipboard";
import {
  searchUser,
  registerUser,
  updateServiceUnitPrice,
  updateUserInfo,
  updateOpenCharge,
  updateOpenSafePay,
  updateOpenInvoice,
  updateOpenAutoPay,
  adminCharge,
  createAppkey,
  selectAppkey,
  updateUserSecurityStatus,
  loginUser,
  chargeTransBatchByAdmin,
  updeteChargeNotifyUrl,
  updateSafePayAccount,
  updateOpenCollectionSafePay,
  updateOpenSafePayOfflineCharge,
  updateOpenSafePayBank,
  updateOpenSafePayNewSignMethod,
  querySafePayBookTotalBalance,
  submitUserRegistration,
  getByUserIdUserRegistration,
  querySafePayBook,
  getPartnerInfo,
  getModifyMobileCheckCode,
  updateMobile,
  userUpdatePartner
} from "@/api/business";
const defaultModel = {
  securityStatus: -1,
  registerTime: null,
  mobile: null,
  name: "",
  operatorUserMobile:"",
  pageNo: 1,
  pageSize: 10,
  count: 0,
};
export default {
  data() {
    return {
      querySafePayBookLoading: false,
      querySafePayBookVisible: false,
      querySafePayBookForm: {
        bookId: null,
      },
      safePayBookAccount: null,
      chargeNotifyUrlVisible: false,
      transBatchgVisible: false,
      searchModel: _.cloneDeep(defaultModel),
      list: [],
      loading: false,
      curData: {},
      tbData: {},
      opLoading: false,
      form: { amount: 0 },
      cnfForm: {
        chargeNotifyUrl: "",
        openChargeNotify: false,
        safePayNotifyUrl: "",
        openSafePayNotify: false,
      },
      tbForm: {
        amount: "",
      },

      updateSafePayAccountForm: {
        userId: null,
        alipayNickName: "",
        batchEnsure: false,
      },

      updateSafePayAccountDialog: false,
      updatePhoneDialog: false,
      updatePhoneForm: {},

      dialogRegister: false,
      registerForm: {

      },

      updatePartnerForm: {
        id: "",
        partner: ""
      },


      dialogRegisterInfo: false, //注册成功信息
      successRegisterForm: {
        gateway: ""
      },

      selectAppkeyDialog: false,
      selectAppkeyForm: {},

      dialogUpdatePartner: false, //合伙人换绑

      industryCategorys: [
        {
          label: "游戏",
          value: "game",
        },
        {
          label: "电商",
          value: "e_commerce",
        },
        {
          label: "技术服务",
          value: "ts",
        },
        {
          label: "人力资源",
          value: "human_resources",
        },
        {
          label: "社交",
          value: "socialize",
        },
        {
          label: "泛娱乐",
          value: "entertainment",
        },
        {
          label: "回收",
          value: "recovery",
        },
        {
          label: "教育",
          value: "education",
        },
        {
          label: "旅游",
          value: "tourism",
        },
        {
          label: "房地产",
          value: "estate",
        },
        {
          label: "交通运输",
          value: "transportation",
        },
        {
          label: "医疗",
          value: "medical",
        },
        {
          label: "其他",
          value: "other",
        },
      ],
      rules: {
        mobile: [{ required: true, message: "请输入手机号", trigger: "blur" }],
      },
      rules4: {
        newMobile: [{ required: true, message: "请输入新手机号", trigger: "blur" }],
        checkCode: [
          { required: true, message: "请输入验证码", trigger: "blur" },
        ],
      },

      servicePriceRules: {
        serviceUnitPrice: [
          { required: true, message: "请输入到支付宝服务费", trigger: "blur" },
        ],
        bankServiceUnitPrice: [
          { required: true, message: "请输入到银行卡服务费", trigger: "blur" },
        ],
        serviceRatio: [
          { required: true, message: "请输入到支付宝收费比例", trigger: "blur" },
        ],
        bankServiceRatio: [
          { required: true, message: "请输入到银行卡收费比例", trigger: "blur" },
        ],
      },
      //注册报备
      userRegistrationVisible: false,
      uRForm: {
        userId: "",
        serviceRatio: "",
        businessLicense: "",
        idCardFront: "",
        idCardBack: "",
        bizSceneDesc: "",
        merchantCommitment: ""
      },
      uRFormRef: {
        businessLicense: [{ required: true, message: "请选择营业执照" }],
        bizSceneDesc: [
          { required: true, message: "请选择业务场景说明书加公章" },
        ],
      },
      // 预览
      previewDialogVisible: false,
      previewImageUrl: "",
      //合伙人
      partnerInfoList: [],

      servicePriceForm: {
        id: "",
        serviceUnitPrice: "",
        bankServiceUnitPrice: "",
        serviceRealPrice: "",
        serviceRatio: "",
        bankServiceRatio: "",
        commissionMode: "",
        benefitRatio: ""
      },
      updateServiceUnitPriceDialog: false,

      updateUserInfoDialog: false,
      updateUserInfoForm: {
        userProfile: {},
      },

      updateUserSecurityStatusDialog: false,
      updateUserSecurityStatusForm: {},
      safePayTotalBalanceSearchDialog: false, //安全发总余额dialog
      safePayTotalBalanceSearchLoading: false,
      allBookBalance: "0.00",
      dialogCharge: false,
      rules2: {
        amount: [
          { required: true, message: "请输入充值金额", trigger: "blur" },
        ],
        memo: [{ required: true, message: "请输入备注", trigger: "blur" }],
      },
      rules3: {
        amount: [
          { required: true, message: "请输入充值次数", trigger: "blur" },
        ],
      },
    };
  },

  components: {
    verifyCode
  },
  methods: {
    // 查看秘钥
    doSelectAppKey(id) {
      let form = {
        id: id
      }

      selectAppkey(form).then((resp => {
        if (resp.success) {
          this.selectAppkeyForm = resp.data
          this.selectAppkeyDialog = true;
          this.search();
        }
      }))
    },
    querySafePayBook() {
      this.querySafePayBookVisible = true;
      this.safePayBookAccount = null;
      this.querySafePayBookForm = {
        bookId: null,
      };
    },
    doQuerySafePayBook() {
      this.querySafePayBookLoading = true;
      querySafePayBook(this.querySafePayBookForm.bookId).then((resp) => {
        if (resp.success) {
          this.safePayBookAccount = resp.data;
        }
        this.querySafePayBookLoading = false;
      });
    },
    whiteSafePayAccount(row) {
      this.updateSafePayAccountForm = {
        userId: row.id,
        alipayNickName: "",
        batchEnsure: false,
      };
      this.updateSafePayAccountDialog = true;
    },
    doWhiteSafePayAccount() {
      this.opLoading = true;
      updateSafePayAccount(this.updateSafePayAccountForm).then((resp) => {
        if (resp.success) {
          this.$notify({
            title: "加白成功",
            type: "success",
            duration: 2500,
          });
          this.updateSafePayAccountDialog = false;
        }
        this.opLoading = false;
      });
    },

    createAppkey(row) {
      this.loading = true;
      createAppkey({ userId: row.id }).then((resp) => {
        if (resp.success) {
          this.$notify.success("操作成功");
          this.search();
        }
        this.loading = false;
      });
    },

    //查询合伙人信息
    getPartnerInfo() {
      getPartnerInfo({}).then((resp) => {
        if (resp.success) {
          this.partnerInfoList = resp.data
          console.log(this.partnerInfoList)
        }
      });
    },
    //手工充值
    charge(data) {
      this.dialogCharge = true;
      this.curData = data;
      this.form = { amount: 0 };
    },

    doCharge() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          this.opLoading = true;

          adminCharge({
            userId: this.curData.id,
            amount: (this.form.amount * 100).toFixed(),
            memo: this.form.memo,
          })
            .then((data) => {
              this.opLoading = false;
              if (data.success) {
                this.$notify({
                  title: "充值成功",
                  type: "success",
                  duration: 2500,
                });
                this.dialogCharge = false;
                this.getList(1);
              }
            })
            .catch((err) => {
              console.log(err);
              this.opLoading = false;
            });
        } else {
          return false;
        }
      });
    },
    //充值体验次数
    chargeTb(data) {
      this.transBatchgVisible = true;
      this.tbData = data;
      this.tbForm = { amount: "" };
    },

    handleOpenCharge(value, id) {
      this.opLoading = true;
      updateOpenCharge({
        openCharge: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openCharge" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },

    chargeTransBatch() {
      this.$refs["tbForm"].validate((valid) => {
        if (valid) {
          this.opLoading = true;
          let formTb = {
            userId: this.tbData.id,
            amount: this.tbForm.amount,
          };
          chargeTransBatchByAdmin(formTb).then((data) => {
            if (data.success) {
              this.$notify({
                title: "操作成功",
                type: "success",
                duration: 2500,
              });
              this.search();
            }
            this.opLoading = false;
            this.transBatchgVisible = false;
          });
        } else {
          return false;
        }
      });
    },
    //安全发总余额查询按钮
    safePayTotalBalanceSearchChanger() {
      this.safePayTotalBalanceSearchDialog = true;
      this.safePayTotalBalanceSearchLoading = true;
      querySafePayBookTotalBalance()
        .then((resp) => {
          if (resp.success) {
            this.allBookBalance = resp.data;
            this.safePayTotalBalanceSearchLoading = false;
          } else {
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    //增加推送地址
    chargeNotifyUrl(data) {
      this.chargeNotifyUrlVisible = true;

      this.cnfForm = {
        id: data.id,
        chargeNotifyUrl: data.userProfile.chargeNotifyUrl,
        openChargeNotify: data.userProfile.openChargeNotify,
        safePayNotifyUrl: data.userProfile.safePayNotifyUrl,
        openSafePayNotify: data.userProfile.openSafePayNotify,
      };
    },
    setUpchargeNotifyUrl() {
      this.opLoading = true;
      let form = {
        id: this.cnfForm.id,
        chargeNotifyUrl: this.cnfForm.chargeNotifyUrl
          ? this.cnfForm.chargeNotifyUrl.trim()
          : "",
        openChargeNotify: this.cnfForm.openChargeNotify,

        safePayNotifyUrl: this.cnfForm.safePayNotifyUrl
          ? this.cnfForm.safePayNotifyUrl.trim()
          : "",
        openSafePayNotify: this.cnfForm.openSafePayNotify,
      };
      updeteChargeNotifyUrl(form).then((data) => {
        if (data.success) {
          this.$notify({
            title: "修改成功",
            type: "success",
            duration: 2500,
          });
          this.search();
        }
        this.opLoading = false;
        this.chargeNotifyUrlVisible = false;
      });
    },
    //是否开放安全付接口
    handleOpenSafePay(value, id) {
      this.opLoading = true;
      updateOpenSafePay({
        openSafePay: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openSafePay" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },

    //是否开放开具发票接口
    handleOpenInvoice(value, id) {
      this.opLoading = true;
      updateOpenInvoice({
        openInvoice: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openInvoice" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },
    //开启安全发签约授权新方式

    handleOpenSafePayNewSignMethod(value, id) {
      this.opLoading = true;
      updateOpenSafePayNewSignMethod({
        openSafePayNewSignMethod: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openSafePayNewSignMethod" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },

    handleOpenCollectionSafePay(value, id) {
      this.opLoading = true;
      updateOpenCollectionSafePay({
        openCollectionSafePay: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openCollectionSafePay" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },

    handleOpenSafePayOfflineCharge(value, id) {
      this.opLoading = true;
      updateOpenSafePayOfflineCharge({
        openSafePayOfflineCharge: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openSafePayOfflineCharge" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },

    //是否开放鱼塘付接口
    handleOpenAutoPay(value, id) {
      this.opLoading = true;
      updateOpenAutoPay({
        openAutoPay: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openAutoPay" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },
    //是否开放安全发到卡接口
    handleOpenSafePayBank(value, id) {
      this.opLoading = true;
      updateOpenSafePayBank({
        openSafePayBank: value,
        id,
      }).then((data) => {
        if (data.success) {
          this.$notify({
            title: "操作成功",
            type: "success",
            duration: 2500,
          });
          this.$refs["openSafePayBank" + id].doClose();
          this.search();
        }
        this.opLoading = false;
      });
    },
    openUpdateUserInfoDialog(row) {
      this.updateUserInfoDialog = true;
      this.updateUserInfoForm = _.cloneDeep(row);
    },

    openUpdateUserSecurityStatusDialog(row) {
      this.updateUserSecurityStatusDialog = true;
      this.updateUserSecurityStatusForm = _.cloneDeep(row);
    },

    doUpdateUserSecurityStatus() {
      this.opLoading = true;
      let form = {
        id: this.updateUserSecurityStatusForm.id,
        securityStatus: this.updateUserSecurityStatusForm.securityStatus,
        securityRemark: this.updateUserSecurityStatusForm.securityRemark,
      };
      console.log(form);
      updateUserSecurityStatus(form).then((resp) => {
        if (resp.success) {
          this.$notify({
            title: "修改成功",
            type: "success",
            duration: 2500,
          });
          this.updateUserSecurityStatusDialog = false;
          this.search();
        }
        this.opLoading = false;
      });
    },

    doUpdateUserInfo() {
      this.opLoading = true;
      let form = {
        id: this.updateUserInfoForm.id,
        name: this.updateUserInfoForm.name,
        remark: this.updateUserInfoForm.remark,
        receiveMobile: this.updateUserInfoForm.userProfile.receiveMobile,
        spareReceiveMobile:
          this.updateUserInfoForm.userProfile.spareReceiveMobile,
        transAmountDayLimit:
          this.updateUserInfoForm.userProfile.transAmountDayLimit,
        batchEnsure: this.updateUserInfoForm.userProfile.batchEnsure,
        strictLogin: this.updateUserInfoForm.userProfile.strictLogin,
        needSafePayAuth: this.updateUserInfoForm.userProfile.needSafePayAuth,
        limitSafePayWebPageTrans: this.updateUserInfoForm.userProfile.limitSafePayWebPageTrans,
        useGoogleAuth: this.updateUserInfoForm.userProfile.useGoogleAuth,
        ensureBatchAmount:
          this.updateUserInfoForm.userProfile.ensureBatchAmount,
        safePayTransAmountDayLimit:
          this.updateUserInfoForm.userProfile.safePayTransAmountDayLimit,
        openSafePayOfflineCharge:
          this.updateUserInfoForm.userProfile.openSafePayOfflineCharge,
        noWechatQrCode:
          this.updateUserInfoForm.userProfile.noWechatQrCode,
        industryCategory:
          this.updateUserInfoForm.industryCategory,
      };
      updateUserInfo(form).then((resp) => {
        if (resp.success) {
          this.$notify({
            title: "修改成功",
            type: "success",
            duration: 2500,
          });
          this.updateUserInfoDialog = false;
          this.search();
        }
        this.opLoading = false;
      });
    },

    openUpdateServiceUnitPriceDialog(row) {
      this.updateServiceUnitPriceDialog = true;
      this.servicePriceForm = _.cloneDeep(row);
      this.servicePriceForm.serviceUnitPrice =
        this.servicePriceForm.serviceUnitPrice / 100;
      if (this.servicePriceForm.bankServiceUnitPrice) {
        this.servicePriceForm.bankServiceUnitPrice =
          this.servicePriceForm.bankServiceUnitPrice / 100;
      }

      this.servicePriceForm.serviceRealPrice =
        this.servicePriceForm.serviceRealPrice / 100;
    },
    doUpdateServiceUnitPrice() {
      this.$refs["servicePriceForm"].validate((valid) => {
        if (valid) {
          this.opLoading = true;
          if (this.servicePriceForm.commissionMode != null && this.servicePriceForm.commissionMode === 'fixed_mode') {
            this.servicePriceForm.fatherCommissionMode = 'fixed_mode';
          }
          updateServiceUnitPrice({
            id: this.servicePriceForm.id,
            mode: this.servicePriceForm.mode,
            serviceRatio: this.servicePriceForm.serviceRatio,
            bankServiceRatio: this.servicePriceForm.bankServiceRatio,
            costServiceRatio: this.servicePriceForm.costServiceRatio,
            bankCostServiceRatio: this.servicePriceForm.bankCostServiceRatio,
            commissionMode: this.servicePriceForm.commissionMode,
            benefitRatio: this.servicePriceForm.benefitRatio,
            fatherBenefitRatio: this.servicePriceForm.fatherBenefitRatio,
            fatherCommissionMode: this.servicePriceForm.fatherCommissionMode,
            fatherServiceRatio: this.servicePriceForm.fatherServiceRatio,
            fatherBankServiceRatio: this.servicePriceForm.fatherBankServiceRatio
          }).then((resp) => {
            if (resp.success) {
              this.$notify({
                title: "修改成功",
                type: "success",
                duration: 2500,
              });
              this.updateServiceUnitPriceDialog = false;
              this.search();
            }
            this.opLoading = false;
          });
        } else {
          return false;
        }
      });
    },

    //复制链接
    doCopy(e) {
      let name = "商户名称：" + this.successRegisterForm.name
      let website = "商户平台：" + this.successRegisterForm.website
      let gateway = "接口网关：" + this.successRegisterForm.gateway
      let mobile = "后台账号：" + this.successRegisterForm.mobile
      let password = "初始密码：" + this.successRegisterForm.password
      let tip = "温馨提示：商户平台账号已经开通，请前往商户平台签约支付宝账号（批量有密/安全发）通过接口对接的商户，也需要先完成支付宝账号签约，再进行接口对接使用"
      let signDoc = "签约文档：https://www.yuque.com/alipaybhd8fvdaz5/lbezo6/ve7wbqig0mmhradp?singleDoc# 《企业支付宝签约安全发流程》 密码：tye6。"
      let apiDoc = "接口文档：https://www.yuque.com/alipaybhd8fvdaz5/vkeaph# 《安全发接口文档》 密码：yf96"

      let info = name + "\n" + website + "\n" + gateway + "\n" + mobile + "\n" + password + "\n" + tip + "\n" + signDoc + "\n" + apiDoc;
      clipboard(info, e);
    },

    //复制接口秘钥
    doCopy1(e) {
      let appkey = "appkey：" + this.selectAppkeyForm.appkey
      let secret = "secret：" + this.selectAppkeyForm.secret

      let info = appkey + "\n" + secret
      clipboard(info, e);
    },
    // 修改手机号
    openUpdatePhone(data) {
      this.updatePhoneDialog = true
      this.updatePhoneForm = _.cloneDeep(data)
    },
    //发送验证码
    sendCheckCode(countDown, fail) {
      let mobile = this.updatePhoneForm.mobile
      getModifyMobileCheckCode(mobile)
        .then((res) => {
          if (res.success) {
            this.$message.success("发送成功");
            countDown();
          } else {
            this.$message.error("发送失败:" + res.resultMessage);
            fail()
          }
        })
        .catch((err) => {
          this.$message.error("发送失败");
          fail();
        });
    },
    doUpdatePhone() {
      this.opLoading = true
      let form = {
        id: this.updatePhoneForm.id,
        checkCode: this.updatePhoneForm.checkCode,
        mobile: this.updatePhoneForm.newMobile
      }
      updateMobile(form).then((resp) => {
        if (resp.success) {
          this.$notify({
            title: "修改成功",
            type: "success",
            duration: 2500,
          });
          this.updatePhoneDialog = false;
          this.search();
        }
        this.opLoading = false;
      })
    },
    //注册
    register() {
      this.dialogRegister = true;
      this.registerForm = {

      };
    },
    //注册报备
    userRegistration(id) {
      this.uRForm.userId = id;
      this.getUserRegistration(this.uRForm.userId);
      this.userRegistrationVisible = true;
    },
    //注册报备 提交
    submitUserRegistration() {
      this.$refs["uRForm"].validate((valid) => {
        if (valid) {
          this.opLoading = true;

          submitUserRegistration({
            userId: this.uRForm.userId,
            serviceRatio: this.uRForm.serviceRatio,
            businessLicense: this.uRForm.businessLicense,
            // idCardFront: this.uRForm.idCardFront,
            // idCardBack: this.uRForm.idCardBack,
            bizSceneDesc: this.uRForm.bizSceneDesc,
            merchantCommitment: this.uRForm.merchantCommitment,
          }).then((resp) => {
            if (resp.success) {
              this.$notify({
                title: "提交成功",
                type: "success",
                duration: 2500,
              });
              this.userRegistrationVisible = false;
              this.search();
            }
            this.opLoading = false;
          });
        } else {
          return false;
        }
      });
    },

    //合伙人换绑
    updatePartner(row) {
      this.dialogUpdatePartner = true
      this.updatePartnerForm = {
        id: _.cloneDeep(row.id),
      }
    },
    //确认合伙人换绑
    doUpatePartner() {
      this.opLoading = true
      let form = {
        id: this.updatePartnerForm.id,
        partnerId: this.updatePartnerForm.partnerId
      }
      userUpdatePartner(form).then((resp) => {
        if (resp.success) {
          this.$notify({
            title: "换绑成功",
            type: "success",
            duration: 2500,
          });
          this.dialogUpdatePartner = false;
          this.search();
        }
        this.opLoading = false;
      })
    },

    handlePictureCardPreview(val) {
      this.previewDialogVisible = true;
      this.previewImageUrl = val;
    },

    getUserRegistration(id) {
      getByUserIdUserRegistration({
        id,
      }).then((resp) => {
        if (resp.success) {
          this.uRForm = resp.data;
          this.uRForm.userId = id;
        }
      });
    },
    handleAvatarSuccess1(res, file) {
      this.uRForm.businessLicense = res.data;
    },
    handleAvatarSuccess2(res, file) {
      this.uRForm.idCardFront = res.data;
    },
    handleAvatarSuccess3(res, file) {
      this.uRForm.idCardBack = res.data;
    },
    handleAvatarSuccess4(res, file) {
      this.uRForm.bizSceneDesc = res.data;
    },
    handleAvatarSuccess5(res, file) {
      this.uRForm.merchantCommitment = res.data;
    },
    beforeAvatarUpload(file) {
      let _this = this;
      return new Promise((resolve, reject) => {
        const isJPEG = file.type === "image/jpeg";
        const isJPG = file.type === "image/jpg";
        const isPNG = file.type === "image/png";

        if (!isJPEG && !isJPG && !isPNG) {
          this.$message({
            message: "请上传jpg 、png、jpeg 类型图片!",
          });
        }
        let isLt5M = file.size / 1024 / 1024 < 5; // 判定图片大小是否小于10MB
        if (isLt5M) {
          resolve()
          return
        }
        console.log("xx")
        let image = new Image(),
          resultBlob = "";
        image.src = URL.createObjectURL(file);
        image.onload = () => {
          // 调用方法获取blob格式，方法写在下边
          resultBlob = _this.compressUpload(image, file);
          resolve(resultBlob);
        };
        image.onerror = () => {
          reject();
        };
      });
    },

    /* 图片压缩方法-canvas压缩 */
    compressUpload(image, file) {
      let canvas = document.createElement("canvas");
      let ctx = canvas.getContext("2d");
      let initSize = image.src.length;
      let { width } = image,
        { height } = image;
      canvas.width = width;
      canvas.height = height;
      ctx.fillRect(0, 0, canvas.width, canvas.height);
      ctx.drawImage(image, 0, 0, width, height);

      // 进行压缩0.5
      let compressData = canvas.toDataURL(file.type || "image/jpeg", 0.5);

      // 压缩后调用方法进行base64转Blob，方法写在下边
      let blobImg = this.dataURItoBlob(compressData);
      return blobImg;
    },

    /* base64转Blob对象 */
    dataURItoBlob(data) {
      let byteString;
      if (data.split(",")[0].indexOf("base64") >= 0) {
        byteString = atob(data.split(",")[1]);
      } else {
        byteString = unescape(data.split(",")[1]);
      }
      let mimeString = data.split(",")[0].split(":")[1].split(";")[0];
      let ia = new Uint8Array(byteString.length);
      for (let i = 0; i < byteString.length; i += 1) {
        ia[i] = byteString.charCodeAt(i);
      }
      return new Blob([ia], { type: mimeString });
    },

    doLogin(row) {
      let form = {
        userId: row.id,
      };
      loginUser(form).then((data) => {
        if (data.success) {
          let resp = data.data;
          if (resp) {
            window.open("http://" + resp);
          }
        }
      });
    },


    //不刷新页数
    search() {
      this.getList();
    },

    searchPage() {
      this.getList(1);
    },

    getList(pageNo) {
      var self = this;
      this.loading = true;
      if (pageNo != undefined) {
        this.searchModel.pageNo = pageNo;
      }

      let searchModel = _.cloneDeep(this.searchModel);
      searchUser(this.compileSearchModel(searchModel))
        .then((data) => {
          self.searchModel.pageNo = ++data.pageNo;
          self.searchModel.count = data.count;
          self.searchModel.pageSize = data.pageSize;
          self.list = data.data;
          self.loading = false;
        })
        .catch((err) => { });
    },
    reset() {
      this.searchModel = _.cloneDeep(defaultModel);
      this.getList();
    },
    compileSearchModel(searchModel) {
      searchModel.pageNo = searchModel.pageNo - 1;

      if (searchModel.registerTime && searchModel.registerTime.length) {
        searchModel["minRegisterTime"] = searchModel.registerTime[0];
        searchModel["maxRegisterTime"] = searchModel.registerTime[1];
      }
      delete searchModel.registerTime;

      return searchModel;
    },
    //修改分页
    handleSizeChange(val) {
      this.searchModel.pageSize = val;
      this.getList(1);
    },
    //修改页面
    handleCurrentChange(val) {
      this.getList(val);
    },
    init() {
      this.getList(1);
      this.getPartnerInfo()
    },
  },
  mounted() {
    this.init();
  },
};
</script>
<style lang="scss">
.my-dialog .el-dialog {
  background-color: transparent;
  box-shadow: 0 0;
}

.my-dialog .el-dialog .el-icon {
  color: #fff;
  font-size: 28px;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}

.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 246px;
  height: 138px;
  line-height: 138px;
  background-color: #fff;
  text-align: center;
}

.avatar {
  width: 246px;
  height: 138px;
  display: block;
}

.avatar-uploader1 .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader1 .el-upload:hover {
  border-color: #409eff;
}
</style>
<style lang="scss" scoped>
.operations {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;

  .operations-1 {
    display: flex;
    width: 180px;

    .line {
      margin-left: 8px;
      color: #cccc;
    }
  }
}

.tip {
  margin-left: 4px;
  color: #409EFF;
  font-size: 16px;
}
</style>
